from django.db import models

# Create your models here.
class TenType(models.Model):
    name=models.CharField(max_length=100)
    class Meta:
        db_table='tentype'
    def __str__(self):
        return self.name
class Tenant(models.Model):
    tsno=models.CharField(max_length=100)
    name=models.CharField(max_length=100)
    status=models.BooleanField(default=False)
    addtime=models.DateTimeField(auto_now=True)
    phone=models.CharField(max_length=100)
    type=models.ForeignKey(TenType,on_delete=models.CASCADE,related_name='ten')
    class Meta:
        db_table='tenant'
    def __str__(self):
        return self.name